package com.woniuxy.springboot04.controller;

import com.woniuxy.springboot04.mapper.RoleMapper;
import com.woniuxy.springboot04.pojo.Role;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class RoleController {
    @Autowired
    private RoleMapper roleMapper;
    @GetMapping("/hello")
    public List<Role> hello(){
        List<Role> roles = roleMapper.selectAll();
        return roles;
    }
}
